cmake_minimum_required(VERSION 3.8)
project(base_interface)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies #添加的功能包
find_package(ament_cmake REQUIRED)#ament_cmake 是 ROS 2 的构建系统的一部分，提供了用于构建和配置 ROS 2 软件包的 CMake 模块
find_package(rosidl_default_generators REQUIRED)#是一个用于生成 ROS 2 消息和服务接口代码的工具
find_package(builtin_interfaces REQUIRED)#包含了 ROS 2 中的一些内建消息类型，如时间和持续时间
find_package(rclcpp REQUIRED)#是 ROS 2 中用于编写节点（Node）的C++库，提供了ROS 2中的基本通信和功能的实现
find_package(std_msgs REQUIRED)#包含了ROS 2中的一些标准消息定义，如字符串、整数等
find_package(nav_msgs REQUIRED)#包含了ROS 2中与导航相关的消息和服务定义
find_package(geometry_msgs REQUIRED)# 包含了ROS 2中与几何形状和变换相关的消息定义

#为接口文件 .msg生成C++代码
rosidl_generate_interfaces(${PROJECT_NAME}
  "msg/ControlCmd.msg"
  "msg/CvData.msg"
  "msg/Hit.msg"
  "msg/Ops.msg"
  "msg/McuComm.msg"
  "msg/TrajectoryCustom.msg"
  DEPENDENCIES  builtin_interfaces geometry_msgs std_msgs nav_msgs
  ADD_LINTER_TESTS
)





if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # comment the line when a copyright and license is added to all source files
  set(ament_cmake_copyright_FOUND TRUE)
  # the following line skips cpplint (only works in a git repo)
  # comment the line when this package is in a git repo and when
  # a copyright and license is added to all source files
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()
